package com.aspose.cells.b.a.c;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class zb {
   public static final String[] a = new String[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
   public static final String[] b = new String[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
   public static final String[] c = new String[]{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""};
   public static final String[] d = new String[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
   private String j = "HH:mm:ss";
   private String k = "HH:mm";
   public String e = "MM/dd/yyyy";
   private String l = "dddd, dd MMMM yyyy";
   private String m;
   public String f = ":";
   public String g = "AM";
   public String h = "PM";
   public String i = "MMMM dd";
   private String n = "yyyy MMMM";
   private String o = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
   private String p = "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
   private String q = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
   private za r;
   private String[] s;

   public zb(za var1) {
      this.r = var1;
      Locale var2 = var1.h();
      DateFormat var3 = DateFormat.getDateInstance(3, var2);
      SimpleDateFormat var4;
      if (var3 instanceof SimpleDateFormat) {
         var4 = (SimpleDateFormat)var3;
         this.e = var4.toPattern();
         int var5 = this.e.indexOf(121);
         if (var5 > -1) {
            int var6 = 1;
            ++var5;

            while(var5 < this.e.length() && this.e.charAt(var5) == 'y') {
               ++var6;
               ++var5;
            }

            if (var6 < 4) {
               StringBuilder var7 = new StringBuilder(this.e.length() + 4 - var6);
               var7.append(this.e.substring(0, var5));

               while(var6 < 4) {
                  var7.append('y');
                  ++var6;
               }

               var7.append(this.e.substring(var5));
               this.e = var7.toString();
            }
         }
      }

      var3 = DateFormat.getDateInstance(1, var2);
      if (var3 instanceof SimpleDateFormat) {
         var4 = (SimpleDateFormat)var3;
         this.l = var4.toPattern();
      }

      var3 = DateFormat.getTimeInstance(2, var2);
      if (var3 instanceof SimpleDateFormat) {
         var4 = (SimpleDateFormat)var3;
         this.k = var4.toPattern();
      }

      var3 = DateFormat.getTimeInstance(1, var2);
      if (var3 instanceof SimpleDateFormat) {
         var4 = (SimpleDateFormat)var3;
         this.j = var4.toPattern();
      }

      var3 = DateFormat.getDateTimeInstance(1, 1, var2);
      if (var3 instanceof SimpleDateFormat) {
         var4 = (SimpleDateFormat)var3;
         this.m = var4.toPattern();
      } else {
         this.m = this.l + " " + this.j;
      }

      if ("zh".equals(var1.h().getLanguage())) {
         this.g = "上午";
         this.h = "下午";
      }

   }

   public static zb a() {
      return za.a().e();
   }

   public static zb b() {
      return za.b().e();
   }

   public String c() {
      return "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
   }

   public String d() {
      return this.l;
   }

   public String e() {
      return this.e;
   }

   public String[] f() {
      if (this.s != null) {
         return this.s;
      } else {
         ArrayList var1 = new ArrayList();

         try {
            this.a(var1, this.a('d'));
            this.a(var1, this.a('D'));
            this.a(var1, this.a('g'));
            this.a(var1, this.a('G'));
            this.a(var1, this.a('f'));
            this.a(var1, this.a('F'));
            this.a(var1, this.a('m'));
            this.a(var1, this.a('M'));
            this.a(var1, this.a('r'));
            this.a(var1, this.a('R'));
            this.a(var1, this.a('s'));
            this.a(var1, this.a('t'));
            this.a(var1, this.a('T'));
            this.a(var1, this.a('u'));
            this.a(var1, this.a('U'));
            this.a(var1, this.a('y'));
            this.a(var1, this.a('Y'));
         } catch (Exception var3) {
            ;
         }

         this.s = new String[var1.size()];
         var1.toArray(this.s);
         return this.s;
      }
   }

   private void a(List var1, String[] var2) {
      if (var1 != null && var2 != null) {
         String[] var3 = var2;
         int var4 = var2.length;

         for(int var5 = 0; var5 < var4; ++var5) {
            String var6 = var3[var5];
            var1.add(var6);
         }

      }
   }

   private String[] a(char var1) throws Exception {
      switch(var1) {
      case 'D':
         return new String[]{this.l};
      case 'E':
      case 'H':
      case 'I':
      case 'J':
      case 'K':
      case 'L':
      case 'N':
      case 'O':
      case 'P':
      case 'Q':
      case 'S':
      case 'V':
      case 'W':
      case 'X':
      case 'Z':
      case '[':
      case '\\':
      case ']':
      case '^':
      case '_':
      case '`':
      case 'a':
      case 'b':
      case 'c':
      case 'e':
      case 'h':
      case 'i':
      case 'j':
      case 'k':
      case 'l':
      case 'n':
      case 'o':
      case 'p':
      case 'q':
      case 'v':
      case 'w':
      case 'x':
      default:
         throw new Exception("Format specifier was invalid.");
      case 'F':
      case 'U':
         return new String[]{this.l + " " + this.j};
      case 'G':
         return new String[]{this.e + " " + this.j};
      case 'M':
      case 'm':
         return new String[]{this.i};
      case 'R':
      case 'r':
         return new String[]{this.o};
      case 'T':
         return new String[]{this.j};
      case 'Y':
      case 'y':
         return new String[]{this.n};
      case 'd':
         return new String[]{this.e};
      case 'f':
         return new String[]{this.l + " " + this.k};
      case 'g':
         return new String[]{this.e + " " + this.k};
      case 's':
         return new String[]{this.p};
      case 't':
         return new String[]{this.k};
      case 'u':
         return new String[]{this.q};
      }
   }
}
